public class Ufo extends Entity
{
  public boolean isDead;
  private PImage ps;

  public Ufo(int xpos, int ypos)
  {
    this.xpos = xpos;
    this.ypos = ypos;
    this.renderSizeX = 64;
    this.renderSizeY = 28;
    
    this.ps = loadImage("Soucoupe.png"); 
    this.isDead = false;
  }

  public void updatePosition(AnimationContext context)
  {
    if (!isDead)
    {
      xpos += context.UfoSpeed;
    }
  }

  public boolean isOutsideZone()
  {
    return xpos > width || xpos < 0;
  }

  public void display()
  {
    if (!isDead)
    {
      image(ps, xpos, ypos, renderSizeX, renderSizeY);
    }
  }
}

